package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysGeneralSurveyMapper;
import com.ruoyi.system.domain.SysGeneralSurvey;
import com.ruoyi.system.service.ISysGeneralSurveyService;

/**
 * 普查问卷问题Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-05-11
 */
@Service
public class SysGeneralSurveyServiceImpl implements ISysGeneralSurveyService 
{
    @Autowired
    private SysGeneralSurveyMapper sysGeneralSurveyMapper;

    /**
     * 查询普查问卷问题
     * 
     * @param questionId 普查问卷问题主键
     * @return 普查问卷问题
     */
    @Override
    public SysGeneralSurvey selectSysGeneralSurveyByQuestionId(Long questionId)
    {
        return sysGeneralSurveyMapper.selectSysGeneralSurveyByQuestionId(questionId);
    }

    /**
     * 查询普查问卷问题列表
     * 
     * @param sysGeneralSurvey 普查问卷问题
     * @return 普查问卷问题
     */
    @Override
    public List<SysGeneralSurvey> selectSysGeneralSurveyList(SysGeneralSurvey sysGeneralSurvey)
    {
        return sysGeneralSurveyMapper.selectSysGeneralSurveyList(sysGeneralSurvey);
    }

    /**
     * 新增普查问卷问题
     * 
     * @param sysGeneralSurvey 普查问卷问题
     * @return 结果
     */
    @Override
    public int insertSysGeneralSurvey(SysGeneralSurvey sysGeneralSurvey)
    {
        sysGeneralSurvey.setCreateTime(DateUtils.getNowDate());
        return sysGeneralSurveyMapper.insertSysGeneralSurvey(sysGeneralSurvey);
    }

    /**
     * 修改普查问卷问题
     * 
     * @param sysGeneralSurvey 普查问卷问题
     * @return 结果
     */
    @Override
    public int updateSysGeneralSurvey(SysGeneralSurvey sysGeneralSurvey)
    {

        sysGeneralSurvey.setUpdateTime(DateUtils.getNowDate());
        return sysGeneralSurveyMapper.updateSysGeneralSurvey(sysGeneralSurvey);
    }

    /**
     * 批量删除普查问卷问题
     * 
     * @param questionIds 需要删除的普查问卷问题主键
     * @return 结果
     */
    @Override
    public int deleteSysGeneralSurveyByQuestionIds(Long[] questionIds)
    {
        return sysGeneralSurveyMapper.deleteSysGeneralSurveyByQuestionIds(questionIds);
    }

    /**
     * 删除普查问卷问题信息
     * 
     * @param questionId 普查问卷问题主键
     * @return 结果
     */
    @Override
    public int deleteSysGeneralSurveyByQuestionId(Long questionId)
    {
        return sysGeneralSurveyMapper.deleteSysGeneralSurveyByQuestionId(questionId);
    }

    @Override
    public List<SysGeneralSurvey> selectSysGeneralSurveyListWithRecordsByCompanyId(SysGeneralSurvey sysGeneralSurvey) {
        return sysGeneralSurveyMapper.selectSysGeneralSurveyListWithRecordsByCompanyId(sysGeneralSurvey);
    }


}
